package com.practice.java0620;

import java.util.Scanner;

public class Twice {

	public static void main(String[] args) {
		int x;
		int y;
		Scanner choice = new Scanner(System.in);
		System.out.println("请输入需要转换的序号：1.华氏转摄氏；2.摄氏转华氏");
		int newChoice = choice.nextInt();
		if (newChoice == 1) {
			System.out.println("请输出需要转换的华氏温度数值：");
			Scanner fh = new Scanner(System.in);
			x = fh.nextInt();
			x = (x - 32) * 5 / 9;
			System.out.println(x);

		} else {
			System.out.println("请输入需要转化的摄氏温度数值");
			Scanner ch = new Scanner(System.in);
			y = ch.nextInt();
			y = y * 9 / 5 + 32;
			System.out.println(y);

		}

	}

}
